<?php

/**
 * 获取axios提交的表单数据
 */
function post() {
    $post = file_get_contents('php://input');
    $post = json_decode($post, true);
    return $post;
}

/**
 * 通过curl请求，触发计划任务
 */
function task($url) {
    $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_TIMEOUT, 1);
    curl_exec($ch);
    curl_close($ch);
}
